{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "opponent-support",
   "metadata": {},
   "source": [
    "https://leetcode.com/problems/add-to-array-form-of-integer\n",
    "\n",
    "\n",
    "Number was too big\n",
    "\n",
    "\n",
    "```cpp\n",
    "#include <vector>\n",
    "#include <algorithm>\n",
    "#include <cmath>\n",
    "#include <sstream>\n",
    "\n",
    "using namespace std;\n",
    "\n",
    "class Solution {\n",
    "public:\n",
    "    vector<int> addToArrayForm(vector<int>& A, int K) {\n",
    "        //6:51\n",
    "        /*\n",
    "        long the_number = 0;\n",
    "        for (int i=A.size()-1; i >= 0; i--) {\n",
    "            if (i == A.size()-1) {\n",
    "                the_number += A[i];\n",
    "            } else {\n",
    "                int power = A.size()-1-i;\n",
    "                the_number += A[i]*pow(10, power);\n",
    "            }\n",
    "        }\n",
    "        */\n",
    "        string string_representation_of_A = \"\";\n",
    "        for (auto i : A) {\n",
    "            string_representation_of_A.push_back((char)(i+48));\n",
    "        }\n",
    "        unsigned long long the_sum = stoull(string_representation_of_A)  + K;\n",
    "\n",
    "        stringstream ss;  \n",
    "        ss << the_sum;  \n",
    "        string the_string;\n",
    "        ss >> the_string;  \n",
    "        vector<int> result;\n",
    "        for(auto c: the_string) {\n",
    "            result.push_back((int)c - 48);\n",
    "        }\n",
    "        return result;\n",
    "        //7:14\n",
    "    }\n",
    "};\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "oriental-machine",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "C++17",
   "language": "C++17",
   "name": "xcpp17"
  },
  "language_info": {
   "codemirror_mode": "text/x-c++src",
   "file_extension": ".cpp",
   "mimetype": "text/x-c++src",
   "name": "c++",
   "version": "17"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
